<?php

namespace app\common\model;

use think\Model;

class TravelOrder extends Model
{
    protected $autoWriteTimestamp = 'int';
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    // 订单状态
    const STATUS_UNPAID = 0;    // 待支付
    const STATUS_PAID = 1;      // 已支付
    const STATUS_SHIPPED = 2;   // 已发货
    const STATUS_FINISH = 3;    // 已完成
    const STATUS_CANCEL = 4;    // 已取消
    const STATUS_REFUND = 5;    // 已退款

    // 关联用户
    public function user()
    {
        return $this->belongsTo('User', 'user_id');
    }

    // 关联文旅信息
    public function travel()
    {
        return $this->belongsTo('Travel', 'travel_id');
    }
}